<%@ page import="top.sehnsucht.service.PhotoService" %>
<%@ page import="top.sehnsucht.service.impl.PhotoServiceImpl" %>
<%@ page import="top.sehnsucht.vo.Photo" %>
<%@ page import="top.sehnsucht.dao.PhotoDao" %>
<%@ page import="top.sehnsucht.dao.impl.PhotoDaoImpl" %>
<%@ page import="top.sehnsucht.dao.UserPhotoDao" %>
<%@ page import="top.sehnsucht.dao.impl.UserPhotoDaoImpl" %>
<%@ page import="top.sehnsucht.service.UserPhotoService" %>
<%@ page import="top.sehnsucht.service.impl.UserPhotoServiceImpl" %>
<%@ page import="top.sehnsucht.vo.UserPhoto" %>
<%@ page import="java.util.ArrayList" %>
<%--
  Created by IntelliJ IDEA.
  User: windows
  Date: 2021/10/29
  Time: 10:08
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <style>
        img {
            width: 100%;
            height: 100%;
        }
    </style>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/layui/css/layui.css">
    <script src="${pageContext.request.contextPath}/layui/layui.js"></script>
    <script src="${pageContext.request.contextPath}/js/jquery-3.6.0.js"></script>
</head>
<body>

<%
    UserPhotoDao userPhotoDao = new UserPhotoDaoImpl();
    UserPhotoService userPhotoService = new UserPhotoServiceImpl(userPhotoDao);
    Integer id = Integer.valueOf(request.getParameter("id"));

    ArrayList<UserPhoto> all = userPhotoService.getPhotoByUserId(id);

    for (UserPhoto userPhoto : all) {
        out.print("<img src=\"" + userPhoto.getPhotoUrl() + "\" alt=\"picture\" >");
    }
%>

</body>
</html>
